---@class SkillEffect556100:BaseSkillEffect
SkillEffect556100 = ClientFight.CreateClass("SkillEffect556100", ClientFight.BaseSkillEffect)
local t = SkillEffect556100
---@param skill FightUsingSkill
---@param summon Fighter
function t:summonEnterSceneBefore(skill, summon)
    summon.cooldowns = {};--清空原技能cd
    local target = skill.target;
    local heroBean = target.heroBean;
    --改变他的模型
    local modelId = summon.modelId;
    summon.heroBean = heroBean;
    summon.modelId = target.modelId;
    local normalSkillId = target.normalAttack.skillId;
    local fight = skill.fight;
    summon.normalAttack = ClientFight.SkillManager.createFightSkill(fight, normalSkillId, summon);
    local parameter = skill.skill.skillBean.f_SkillScriptParameter;
    local skills = clone(skill.target.skills);
    table.addAllToArr(skills, skill.target.passiveskills);
    local extType = {};
    for k, _skill in pairs(skills) do
        if (target.heroBean.f_HeroID == 610 and _skill.skillType == 4) then
            --西泽,强行继承技能3
        else
            if not table.contains(parameter, _skill.skillType) then
                goto continue;
            end
        end
        --继承爸爸的技能
        ClientFight.SkillManager.addSkill(fight, summon, _skill.skillId, _skill.skillType);
        table.insert(extType, _skill.skillType);
        ::continue::
    end
    -- 排序
    table.sort(summon.skills, function(o1, o2)
        if (o1.skillBean.f_SkillPriority > o2.skillBean.f_SkillPriority) then
            return -1;
        elseif (o1.skillBean.f_SkillPriority < o2.skillBean.f_SkillPriority) then
            return 1;
        end
        return 0;
    end);
    if (target.puppet ~= nil) then
        local puppet = fighterManager.createSummonsFighter(fight, skill.fighter, modelId, FighterAiTypeEnum.DAI_BI, SummonsType.ENTITY, null, 1000);
        puppet.summonsExpireFrame = summon.summonsExpireFrame;
        puppet.lifeFrame = summon.lifeFrame;
        puppet.modelId = 611;
        summon.puppet = puppet;
        --            summon.setInitPosition(summon.getPosition());
        --            fight.getActions().add(ReportManager.fighterToJsonString(fight, puppet.getPuppet(), 0));
        --            fighterManager.addPassiveSkillEffect(fight, puppet.getPuppet());
    end
    local exValue = skill.skill.skillBean.f_SkillScriptParameter[1];
    local values = FighterAttributeEnum:values();
    local attr = {};
    for i = 1, table.getn(values) do
        local attrEnum = values[i];
        local value = 10000;
        if (attrEnum.id == FighterAttributeEnum.ATK.id or attrEnum.id == FighterAttributeEnum.HP.id or attrEnum.id == FighterAttributeEnum.DEF.id) then
            value = exValue;
        end
        attr[i] = { attrEnum.id, value };
    end
    --继承属性
    summon.attributes = {};
    FighterAttributeManager.cloneAllAttr(target, summon, {}, attr);

    FighterAttributeManager.initFighterAttribute(fight, summon);
    -- 初始开始血量
    summon.hp = FighterAttributeManager.getFightAttr(summon, FighterAttributeEnum.HP);
end

t.New()